package cn.blog.controller.front;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.blog.controller.BaseServlet;
import cn.blog.service.front.CompileHeadService;
import cn.blog.service.front.Xiugaimima_rightService;

@WebServlet("/front/xiugaimimaright")
public class Xiugaimima_right extends BaseServlet {
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		forward("front/xiugaimimaright");
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		CompileHeadService chs = new CompileHeadService();
		// 获取用户id
		String userId = req.getSession().getAttribute("userId").toString();
		int uid = Integer.parseInt(userId);
		String password = req.getParameter("password");
		Xiugaimima_rightService xgrs = new Xiugaimima_rightService();
		int num = xgrs.updatePass(password, uid);
		redirect("/front/xiugaimimaright");
		
		
	}
}
